package com.yoso.shop.infrastructure.utils;

import java.util.Random;
import java.util.UUID;

public class IDUtil {

    public static String getUUID(){
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    public static String getOrderId(){
        char[] s= {'1','2','3','4','5','6','7','8','9','0'};
        Random random = new Random();
        StringBuilder id = new StringBuilder();
        for (int i = 0; i < 12; i++) {
            int index = random.nextInt(9);
            id.append(s[index]);
        }
        return id.toString();
    }
}
